import request from '@/config/axios'

export interface ProtocolDocumentVO {
  id: number
  code: string
  type: number
  title: string
  content: string
  status: number
}

// 查询跑步协议文件列表
export const getProtocolDocumentPage = async (params) => {
  return await request.get({ url: `/system/protocol-document/page`, params })
}

// 查询跑步协议文件详情
export const getProtocolDocument = async (id: number) => {
  return await request.get({ url: `/system/protocol-document/get?id=` + id })
}

// 新增跑步协议文件
export const createProtocolDocument = async (data: ProtocolDocumentVO) => {
  return await request.post({ url: `/system/protocol-document/create`, data })
}

// 修改跑步协议文件
export const updateProtocolDocument = async (data: ProtocolDocumentVO) => {
  return await request.put({ url: `/system/protocol-document/update`, data })
}

// 删除跑步协议文件
export const deleteProtocolDocument = async (id: number) => {
  return await request.delete({ url: `/system/protocol-document/delete?id=` + id })
}

// 导出跑步协议文件 Excel
export const exportProtocolDocument = async (params) => {
  return await request.download({ url: `/system/protocol-document/export-excel`, params })
}
